<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //递归
        function demo(num) {
            if(num <= 1) {
                return 1;
            }
            return num + demo(num - 1)
        }
        console.log(demo(5)) 

        //斐波那契数列
        function ickt(num) {
            if(num ===1 || num ===2) {
                return 1;
            }
            return ickt(num - 1) + ickt(num - 2);
        }
        console.log(ickt(7))
    </script>
</body>
</html>